using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UpgradeKeepTheFlow:Upgrade {

	protected override void SubscribeEvents() {
		base.SubscribeEvents();
		Mob.Damaged+=Mob_Damaged;
	}


	public override void UnsubscribeEvents() {
		base.UnsubscribeEvents();
		Mob.Damaged-=Mob_Damaged;
	}

	private void Mob_Damaged(object _sender,DamageEventArgs e) {
		Mob sender = _sender as Mob;
		if(e.stat.attackerWeapon!=weapon.weapon) return;
		if(e.stat.crit&&Utility.Chance(0.75f)) sender.buffs[typeof(BuffVulnerability)].stacks++;
		if(e.stat.attackerProjectile.stat.inaccuracy<=1&&Utility.Chance(0.2f)) sender.buffs[typeof(BuffVulnerability)].stacks++;
	}
}